package cn.tedu;

import java.sql.*;

public class Demo04 {
    public static void main(String[] args) throws SQLException {
        //1.创建链接对象
        try (Connection conn = DBUtils.getConn()) {
            Statement s=conn.createStatement();
            ResultSet rs=s.executeQuery("select name from emp");
            while(rs.next()){
                String name=rs.getString(1);
                System.out.println(name);
            }
        }catch (SQLException throwables){
            throwables.printStackTrace();
        }
    }
}
